package com.example.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class FourthTest {

    @ResponseBody
    @RequestMapping("/test")
    public ModelAndView test01() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("key", "欢迎回来!!!");
        modelAndView.setViewName("index");
        return modelAndView;
    }
}
